<%@ page import="com.future.Task" %>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="layout" content="main"/>
<g:set var="entityName" value="${message(code: 'task.label', default: 'Task')}"/>
<title><g:message code="default.create.label" args="[entityName]"/></title>
</head>
<body>
 <div class="nav">
  <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
  <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]"/></g:link></span>
</div>
<div class="body_1"style="width:800;text-align:left">

  <h1><g:message code="default.create.label" args="[entityName]"/></h1>
  <g:if test="${flash.message}">
    <div class="message">${flash.message}</div>
  </g:if>
  <g:hasErrors bean="${taskInstance}">
    <div class="errors">
      <g:renderErrors bean="${taskInstance}" as="list"/>
    </div>
  </g:hasErrors>
  <g:form action="save" method="post">
    <div class="dialog">
      <table style="width:100%">
        <tbody>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="taskSerialNumber"><g:message code="task.taskSerialNumber.label" default="Task Serial Number"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'taskSerialNumber', 'errors')}">
            <input id="taskSerialNumber" name="taskSerialNumber" type="text" readonly name="taskSerialNumber" value="${taskSerialNumber()}"/>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="taskName"><g:message code="task.taskName.label" default="Task Name"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'taskName', 'errors')}">
            <g:textField name="taskName" value="${taskInstance?.taskName}"/>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="taskPlanCycle"><g:message code="task.taskPlanCycle.label" default="Task Plan Cycle"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'taskPlanCycle', 'errors')}">
            <g:textField name="taskPlanCycle" value="${fieldValue(bean: taskInstance, field: 'taskPlanCycle')}"/>
          </td>
        </tr>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="user"><g:message code="task.user.label" default="user"/></label>
          </td>
          <td valign="top" class="value">
            <g:select name="user.id" from="${com.future.User.list()}" optionKey="id" optionValue="userName" value="user.id"/>
          </td>
        </tr>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="taskRelationship"><g:message code="task.taskRelationship.label" default="Task Relationship"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'taskRelationship', 'errors')}">
            <g:select name="taskRelationship.id" from="${com.future.Task.list()}" optionKey="id" value="${taskInstance?.taskRelationship?.id}" noSelection="['null': '']"/>
          </td>
        </tr>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="taskInfo"><g:message code="task.taskInfo.label" default="Task Info"/></label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: taskInstance, field: 'taskInfo', 'errors')}">
            <fckeditor:editor  toolbar="Standard" id='taskInfo' name='taskInfo' width="700" height="350">${taskInstance?.taskInfo}</fckeditor:editor>
          </td>
        </tr>
        </tbody>
      </table>
    </div>
    <div class="buttons">
      <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}"/></span>
    </div>
  </g:form>
</div>
</body>
</html>
